Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize: change contract function visibility to "external" #465

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paco0x
Copy link

@paco0x paco0x commented Feb 1, 2024

In verifyProof function, it uses yul functions like calldataload & return, which will be interpreted to CALLDATALOAD and RETURN opcodes, and these opcodes only make sense when the calling context is an external call.

Currently, the visibility of the generated contract functions are public and may be used unexpected as an internal call by inherit the generated contract, like:

contract MisusingVerifier is FflonkVerifier {
    function verify(...) {
        verifyProof(...)     // this will be an internal call and unexpected results may occur
    }
}

This PR changes public to external to avoid unexpected usage of the verifier contracts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant